
//import * as echarts from 'echarts';导包引入
// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
var option = {
    title: {
        text: '数据变动太小,下面测试'
    },
    tooltip: {},//提示组件
    legend: {
        data:['步数']
    },
    xAxis: {//直角系坐标X轴
        data: ["1号","2号","3号","4号","5号","6号"]
    },
    yAxis: {},
    series: [{
        name: '步数',
        type: 'bar',//图的类型，有折线line,柱状bar,饼pie,树tree
        data: [500, 200, 360, 100,400 , 320]
    }]
};
myChart.setOption(option);
//饼图
var myChart1 = echarts.init(document.getElementById('main1'));
var  option1 = {
    tooltip: {
        trigger: 'item'
    },
    legend: {
        top: '5%',
        left: 'center'
    },
    series: [
        {
            name: '数据量',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            label: {
                show: false,
                position: 'center'
            },
            emphasis: {
                label: {
                    show: true,
                    fontSize: '40',
                    fontWeight: 'bold'
                }
            },
            labelLine: {
                show: false
            },
            data: [
                {value: 1048, name: '设备1'},
                {value: 735, name: '设备2'},
                {value: 580, name: '设备3'},
                {value: 484, name: '设备4'},
            ]
        }
    ]
};
myChart1.setOption(option1);